package controllers.product;

import java.util.List;

import javax.persistence.PersistenceException;

import models.Comment;
import play.mvc.Controller;

public class CommentController extends Controller {

	// static Form<Comment> commentForm = form(Comment.class);

	public static List<Comment> getList(Long productId) {
		try {
			return Comment.find.where().eq("product_id", productId)
					.orderBy("date DESC").findList();
		} catch (PersistenceException e) {
			return null;
		}

	}
}
